<template>
  <div id="app">
    <router-view/>
  </div>
</template>
<script>
export default {
  name: 'app',
  data () {
    return {

    }
  },
  mounted () {
    if (this.$cookie.get('admin')) {
      this.getUser()
    }
  },
  methods: {
    getUser () {
      this.axios.get('/api/user.json').then((res) => {
        const user = res.userNumber
        const { username } = user
        this.$store.dispatch('saveUserName', username)
      })
    }
  }
}
</script>
<style lang="scss">
@import "assets/scss/reset";
@import "assets/scss/config";
</style>
